package org.sang.bbbig.model;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.influxdb.annotation.Column;
import org.influxdb.annotation.Measurement;


@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@Measurement(name = "temperature")
public class Temperature {
    // Column中的name为measurement中的列名
    // 此外,需要注意InfluxDB中时间戳均是以UTC时保存,在保存以及提取过程中需要注意时区转换
    @Column(name = "time")
    private Long time;
    // 注解中添加tag = true,表示当前字段内容为tag内容
    @Column(name = "machine", tag = true)
    private String machine;
    @Column(name = "type", tag = true)
    private String type;
    @Column(name = "lat")
    private Float external;
    @Column(name = "long")
    private Float internal;

    public Long getTime() {
        return time;
    }

    public void setTime(Long time) {
        this.time = time;
    }

    public String getMachine() {
        return machine;
    }

    public void setMachine(String machine) {
        this.machine = machine;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Float getExternal() {
        return external;
    }

    public void setExternal(Float external) {
        this.external = external;
    }

    public Float getInternal() {
        return internal;
    }

    public void setInternal(Float internal) {
        this.internal = internal;
    }
}